import Vue from 'vue'
import VueRouter from 'vue-router'

import UserList from '@/components/UserList/UserList.vue'
import UserInfo from '@/components/UserInfo/UserInfo.vue'

Vue.use(VueRouter)

const router = new VueRouter({
    routes: [
        { path: '/', redirect: '/user' },
        { path: '/user', component: UserList, name: 'user' },
        { path: '/users/:id', component: UserInfo, name: 'userinfo', props: true }
    ]
})

export default router